package com.pengtu.gsj.entity.jsbz;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;


/**
 * 技术保障 防护性养护管理 路面材料回收
 * RoadMaterial
 * 
 * 2017年6月14日 上午10:31:53
 * @author heyong
 *
 */

@Entity
@Table(name = "T_JS_ROADMATERIAL")
public class RoadMaterial extends IdEntity {
	private static final long serialVersionUID = 1L;
	
	private String projectName;         //项目名称                
	private String projectNumber;       //项目编号
	private String roadCode;      		//路段代码
	private String roadName;            //道路名称
	private String projectPoint;        //项目概括
	private String projectLocation;     //工程位置
	private String testYear;            //年份 
	private Double asphaltLayer;        //沥青砼面层处治量
	private Double asphalMaterial;      //沥青砼材料回收量
	private Double cementLayer;         //水泥砼面层处治量
	private Double cementMaterial;      //水泥砼材料回收量
	private Double total;               //实际回收总量
	private Double planTotal;           //计划回收总量    
	private Double recyclingRate;       //回收率      
	private String remark;				//备注
	
	private Double projectMark; //项目分数
	
	private Integer bulletinNumber;     //检测文件数
	private List<Attachment> attachments;
	
	public RoadMaterial() {
	}

	public RoadMaterial(String testYear) {
		this.testYear = testYear;
	}

	public RoadMaterial(String testYear, Double asphaltLayer, Double asphalMaterial, Double cementLayer, Double cementMaterial, Double recyclingRate) {
		this.testYear = testYear;
		this.asphaltLayer = asphaltLayer;
		this.asphalMaterial = asphalMaterial;
		this.cementLayer = cementLayer;
		this.cementMaterial = cementMaterial;
		this.recyclingRate = recyclingRate;
	}

	@Column(name = "PROJECTNAME")
	public String getProjectName() {
		return projectName;
	}
	
	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	@Column(name = "PROJECTNUMBER")
	public String getProjectNumber() {
		return projectNumber;
	}
	public void setProjectNumber(String projectNumber) {
		this.projectNumber = projectNumber;
	}
	@Column(name = "ROADCODE")
	public String getRoadCode() {
		return roadCode;
	}
	public void setRoadCode(String roadCode) {
		this.roadCode = roadCode;
	}
	@Column(name = "ROADNAME")
	public String getRoadName() {
		return roadName;
	}
	public void setRoadName(String roadName) {
		this.roadName = roadName;
	}
	@Column(name = "PROJECTPOINT")
	public String getProjectPoint() {
		return projectPoint;
	}
	public void setProjectPoint(String projectPoint) {
		this.projectPoint = projectPoint;
	}
	@Column(name = "PROJECTLOCATION")
	public String getProjectLocation() {
		return projectLocation;
	}
	public void setProjectLocation(String projectLocation) {
		this.projectLocation = projectLocation;
	}
	@Column(name = "TESTYEAR")
	public String getTestYear() {
		return testYear;
	}
	public void setTestYear(String testYear) {
		this.testYear = testYear;
	}
	@Column(name = "ASPHALTLAYER")
	public Double getAsphaltLayer() {
		return asphaltLayer;
	}
	public void setAsphaltLayer(Double asphaltLayer) {
		this.asphaltLayer = asphaltLayer;
	}
	@Column(name = "ASPHALMATERIAL")
	public Double getAsphalMaterial() {
		return asphalMaterial;
	}
	public void setAsphalMaterial(Double asphalMaterial) {
		this.asphalMaterial = asphalMaterial;
	}
	@Column(name = "CEMENTLAYER")
	public Double getCementLayer() {
		return cementLayer;
	}
	public void setCementLayer(Double cementLayer) {
		this.cementLayer = cementLayer;
	}
	@Column(name = "CEMENTMATERIAL")
	public Double getCementMaterial() {
		return cementMaterial;
	}
	public void setCementMaterial(Double cementMaterial) {
		this.cementMaterial = cementMaterial;
	}
	@Column(name = "TOTAL")
	public Double getTotal() {
		return total;
	}
	public void setTotal(Double total) {
		this.total = total;
	}
	@Column(name = "PLANTOTAL")
	public Double getPlanTotal() {
		return planTotal;
	}
	public void setPlanTotal(Double planTotal) {
		this.planTotal = planTotal;
	}
	@Column(name = "RECYCLINGRATE")
	public Double getRecyclingRate() {
		return recyclingRate;
	}
	public void setRecyclingRate(Double recyclingRate) {
		this.recyclingRate = recyclingRate;
	}
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	
	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}

	@Transient
	public Double getProjectMark() {
		return projectMark;
	}

	public void setProjectMark(Double projectMark) {
		this.projectMark = projectMark;
	}
}
